Vendors: consume precompiled MafiaNet release archives - #261
Conversation
Replace the FetchContent source build of MafiaNet with a download of the per-platform precompiled archive published by MafiaNet's release pipeline (static + shared libs, bundled opus/rnnoise, headers, CMake package). The archive is fetched at configure time into the build tree and consumed via find_package(MafiaNet CONFIG); consumers keep linking MafiaNet::MafiaNetStatic unchanged. The pin in cmake/MafiaNetPin.cmake (same path, so bump_version.sh keeps its wire-format signal) now names the release version plus the SHA-256 of each archive: tags are mutable refs, so the hashes are what actually pin content (file(DOWNLOAD EXPECTED_HASH) fails the configure on any mismatch). The archives carry a single Release configuration compiled with /MD on Windows -- the CRT FrameworkSetup forces even in Debug -- so Debug/ RelWithDebInfo/MinSizeRel are mapped onto it via MAP_IMPORTED_CONFIG_*, and the old _DEBUG/CRT reconciliation block for the source build is deleted. find_package imports are directory-scoped, unlike the old alias targets, so the imported targets are promoted IMPORTED_GLOBAL for the consumers under code/ (the GLOBAL keyword needs CMake 3.24; minimum here is 3.20).
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughMafiaNet now uses versioned, SHA-256-pinned precompiled archives. CMake selects the platform archive, verifies and extracts it, loads ChangesMafiaNet archive integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The build now downloads and verifies pinned MafiaNet release archives instead of compiling the dependency from source; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant CMakeConfigure
participant MafiaHubRelease
participant ArchiveExtractor
participant MafiaNetPackage
CMakeConfigure->>MafiaHubRelease: Download pinned platform archive
MafiaHubRelease-->>CMakeConfigure: Return archive
CMakeConfigure->>CMakeConfigure: Verify SHA-256
CMakeConfigure->>ArchiveExtractor: Extract archive
ArchiveExtractor-->>CMakeConfigure: Provide MafiaNetConfig.cmake
CMakeConfigure->>MafiaNetPackage: find_package(MafiaNet)
MafiaNetPackage-->>CMakeConfigure: Provide imported targets
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CMAKE_MAP_IMPORTED_CONFIG_* was live during find_package(MafiaNet), so it
also seeded the OpenSSL::SSL/Crypto imported targets that
find_dependency(OpenSSL) creates inside that call. Those carry a single
config-less IMPORTED_LOCATION, and a mapping they cannot satisfy fails
Debug configures ('IMPORTED_LOCATION not set for ... configuration
Debug') -- exactly what the Linux/macOS CI legs hit. Set
MAP_IMPORTED_CONFIG_* directly on the MafiaNet targets instead, in the
same loop that promotes them IMPORTED_GLOBAL.
What
Replaces the
FetchContentsource build of MafiaNet with a configure-time download of the per-platform precompiled archive published by MafiaNet's release pipeline (linux-x86_64, windows-x86/x64, macos-x86_64/arm64 — static + shared libs, bundled opus/rnnoise, all headers, and theMafiaNetConfig.cmakepackage). The archive is extracted into the build tree and consumed viafind_package(MafiaNet CONFIG REQUIRED); consumers keep linkingMafiaNet::MafiaNetStaticunchanged.Why
Building MafiaNet from source dragged ~85 MB of third-party source (plus its own Opus/RNNoise fetches) through every cold configure. Downloading one ~12 MB archive is faster and keeps the dependency boundary where it belongs.
Details
cmake/MafiaNetPin.cmakekeeps its path (sobump_version.shkeeps its wire-format signal) but now names the release version plus the SHA-256 of each archive. Tags are mutable refs, so the hashes are what actually pin content —file(DOWNLOAD EXPECTED_HASH)fails the configure on any mismatch. Bumping MafiaNet = update the version and five hashes, nothing else./MDon Windows — exactly the CRT FrameworkSetup forces even in Debug — so Debug/RelWithDebInfo/MinSizeRel are mapped onto it viaMAP_IMPORTED_CONFIG_*, and the old_DEBUG/CRT reconciliation block for the source build is deleted.find_packageimports are directory-scoped, unlike the old alias targets, so they are promotedIMPORTED_GLOBALfor the consumers undercode/(theGLOBALkeyword needs CMake 3.24; minimum here is 3.20).find_dependency(OpenSSL): the vendored 3.3.1 on Windows, the system one elsewhere — matching the OpenSSL 3 the archives were compiled against.Verification
On macOS arm64: clean reconfigure downloads and hash-verifies
MafiaNet-0.15.0-macos-arm64.tar.gz,FrameworkServerbuilds, andFrameworkTestslinks against the prebuilt static libs and passes 206/206 tests across 18 modules. Windows/Linux archives were inspected for correct arch and CRT (x86_64/i386 PE machine types, /MD Release objects; ELF glibc ≤ 2.34) but the CI run on this PR is their first real Framework build.Summary by CodeRabbit